package Text6;

import java.util.*;


public class Main {
    static int N = 20, n;
    static boolean[] st = new boolean[N];

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        n = in.nextInt();
        dfs(1);
    }

    private static void dfs(int u) {
        if (u > n) {
            for (int i = 1; i <=n ; i++) {
                if(st[i]){
                    System.out.print(i+" ");
                }
            }
            System.out.println();
            return;
        }
        st[u]=true;
        dfs(u+1);

        st[u]=false;
        dfs(u+1);
    }
}
